<ion-view view-title="销售单详情">

  

    <ion-content class="wrap-light2 supplier-theOrder">

	<ion-list>

		<ion-item class="item-icon-left">
		    <span class="list-label text-right">开单时间</span>
		    <time>{{theOrder.date | date:'yyyy-MM-dd hh:mm:ss'}}</time>
		</ion-item>

		<ion-item class="item-icon-left">
		    <span class="list-label text-right">类型</span>
		    <time>{{theOrder.price_type}}</time>
		</ion-item>

		<ion-item class="item-icon-left">
		    <span class="list-label text-right">状态</span>
		    <span class="balanced">{{theOrder.state}}</span>
		</ion-item>

		<ion-item class="item-icon-left item-icon-right" ng-if="theOrder.customer.name">
		    <span class="list-label text-right">客户</span>
		    <span>{{theOrder.customer.name}}</span>
		</ion-item>

		<ion-item class="item item-divider margin-top-large">
		    销售清单
		</ion-item>

		<ion-item class="product-property margin-bottom-large" ng-repeat="product in theOrder.list">
		    <div class="row row-center row-nopadding">
				<div class="col">
					<h2>{{product.properties.brand.value}}{{product.properties.model.value}}</h2>
					<div class="meta padding-bottom">
						<span>数量：{{product.count}} 部 </span>
						<span>成交单价：{{product.final_price | currency:'￥'}} </span>
						<span class="pull-right nomargin">小计：{{product.final_price * product.count | currency:'￥'}}</span>
					</div>
					<div class="prop-list item-accordion">
					 <!-- ng-if="isItemShown(product)" -->
						<p ng-repeat="property in product.properties" class="prop-item" ng-if="property.name!='品牌' && property.name!='型号'">
							<span class="prop-label">{{property.name}}:</span>
							<span class="prop-value">{{property.value}}</span>
						</p>
					</div>
				</div>
				<div class="text-right">{{product.state}}</div>
			</div>
			<div class="product-check item item-button-right">
		    	<span>已扫描 <span class="assertive">{{product.inventory_check}}</span> 件 / 共 <span class="assertive">{{product.count}}</span> 件</span>
		    	<button type="button" class="button button-col icon-left ion-ios-barcode-outline" ng-click="scanBarcode($index)"> 扫码</button>
			</div>

		    <textarea rows="2" ng-model="newSupplier.remark" placeholder="备注"></textarea>
		</ion-item>


		<ion-item ng-if="theOrder.amount">
			<div class="padding-bottom">总计：</div>
			<div>
				<span class="padding-right"><span class="royal">{{theOrder.total_count}}</span> 件</span>
				<span class="pull-right royal">{{theOrder.amount | currency:'￥'}}</span>
			</div>
		</ion-item>
	</ion-list>

  </ion-content>

    <div class="bar bar-footer bar-balanced" ng-if="theOrder.state=='待付款' && isOrderCorrect">
	    <a class="title" ng-click="checkout();">
	      结 算
	    </a>
  </div>

</ion-view>
